Learn R Programming

largeList (version 0.3.1)

[.largeList: Overload of operator [].

Description

Overload of operator [].

Usage

# S3 method for largeList
[(x, index = NULL)

Arguments

x
A largeList object created by getList.
index
A numeric, logical or character vector.

Value

A list

Details

It behaviours the same as a normal list object.

See Also

largeList

Examples

Run this code
largelist_object <- getList("example.llo", truncate = TRUE)
largelist_object[[]] <- list("A" = 1, "B" = 2, "C" = 3)  ## assign list to the list file
largelist_object[c(1, 2)] ## get list("A" = 1, "B" = 2)
largelist_object[c(TRUE, FALSE, TRUE)] ## get list("A" = 1, "C" = 3)
largelist_object[c("A", "C")] ## get list("A" = 1, "C" = 3)

Run the code above in your browser using DataLab